import java.util.Arrays;
import java.util.Scanner;

public class Answer2 {
    //组队竞赛
    // 要注意数据大小
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            int[] arr = new int[n * 3];
            for (int i = 0; i < n * 3; i++) {
                arr[i] = in.nextInt();
            }
            Arrays.sort(arr);
            int sum = 0;
            int i = n * 3 - 2;
            while(n-- !=0){
                sum+=arr[i];
                i-=2;
            }
            System.out.println(sum);
        }
    }
}
